package com.greatchn.authorization_server.web.po;

import org.hibernate.annotations.Proxy;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @OauthUserGroupInfo:
 * @author: ZBoHang
 * @time: 2023/2/28 9:07
 */
@Entity
@Table(name = "oauth_user_group_info", schema = "sso", catalog = "")
public class OauthUserGroupInfo implements Serializable {
    private static final long serialVersionUID = 5069742015346758571L;
    private Integer userGroupId;
    private String userGroupName;
    private Integer parentId;
    private String desc;
    private String state;
    private Timestamp createTime;

    @Id
    @Column(name = "user_group_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getUserGroupId() {
        return userGroupId;
    }

    public void setUserGroupId(Integer userGroupId) {
        this.userGroupId = userGroupId;
    }

    @Basic
    @Column(name = "user_group_name", nullable = true, length = 255)
    public String getUserGroupName() {
        return userGroupName;
    }

    public void setUserGroupName(String userGroupName) {
        this.userGroupName = userGroupName;
    }

    @Basic
    @Column(name = "parent_id", nullable = true)
    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "desc", nullable = true, length = 255)
    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    @Basic
    @Column(name = "state", nullable = true, length = 1)
    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Basic
    @Column(name = "create_time", nullable = true)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OauthUserGroupInfo that = (OauthUserGroupInfo) o;
        return Objects.equals(userGroupId, that.userGroupId) && Objects.equals(userGroupName, that.userGroupName) && Objects.equals(parentId, that.parentId) && Objects.equals(desc, that.desc) && Objects.equals(state, that.state) && Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userGroupId, userGroupName, parentId, desc, state, createTime);
    }
}
